Using Obsidian + Zotero for Scientific Research
This toturial isbased on below sources:
1- How to Boost Your Productivity for Scientific Research Using Obsidian
2- Obsidian Tutorial for Academic Writing
Knowledge is the most powerful tool you have as a researcher. Knowledge, however, is worthless if it cannot be accessed quickly and effectively. The key is in a consistent and easy-to-use method of archiving information so that taking notes becomes an effortless and pleasing experience.
The article is divided into three parts:
Philosophy:
The basics of a Knowledge management system such as what is a note, how to organize notes, tags, folders, and links.
This section is meant to be tool-agnostic, meaning that you should be able to implement most of these tips with any note-taking app.
Tools:
How to set up and use Obsidian, how to manage notes, reading lists, and useful plugins.
This section shows how to use Obsidian, my tool of choice, to manage scientific knowledge effectively.
Workflows:
How to link Zotero and take notes from papers, maintain notes of multiple projects, set up SQL-like queries to generate Maps of Content (MOCs) automatically with Dataview, encrypt your valut, and more.
This section focuses on giving a detailed description of how to use Obsidian to solve common problems in the scientific world and manage/maintain your knowledge effectively.
Throughout the article I will use the word library to mean your entire digital knowledge (library), which is used interchangeably with “Obsidian Vault” or “Zettelkasten”.
1. Philosophy: How to take and organize notes effectively
Before we dive into Obsidian, it’d be good to first lay out the foundations of a Personal Knowledge Management System and Zettelkasten. The inspiration for this section and a lot of the work on Zettelkasten is from Niklas Luhmann, an outstandingly productive sociologist who wrote 400 papers and 70 books. Zettelkasten means (literally) “slip box” (or library in this article). In his case, his Zettlekasten had around 90000 physical notes, which have been digitized. Nowadays, there are loads of tools available to make this process easier and more intuitive. Obsidian, specifically has a good introduction section on their website: https://publish.obsidian.md/hub/
Notes
We will start by considering “What is a note?”. Although it seems like a trivial question, the answer to this may vary depending on the topic or your style of notes. The idea, however, is that a note is as “atomic” (ie. self-contained) as possible. You should be reading the note and understand the idea immediately.
The resolution of your notes depends on how much detail you have for that note. For example, a note about “Deep Learning” could be just a general description of what Neural Networks are, and maybe a few notes on the different types of architectures (eg. Recurrent Neural Networks, Convolutional Neural Networks, etc..).
A good rule of thumb to have is to limit length and detail. If you require more detail, in a specific section of this note, it would make sense to break it up into several smaller notes. So, from our original note “Deep Learning” we now have three notes:
Deep Learning
Recurrent Neural Networks
Convolutional Neural Networks
#Tags and [[Links]] over /Folders/
For example, Deep Learning has been used for Protein Structure prediction (AlphaFold) and image classification (ImageNet). Now, if you had a folder structure like this:
- /Proteins/
- Protein Folding
- /Deep Learning/
- Convolutional Neural Networks
Your notes about Protein Folding and Convolutional Neural Networks will be independent and when you are in the “Protein” folder, you won’t be able to find notes about Neural Networks.
There are several ways to solve this problem. The most common one is to use tags rather than folders. This way, one note can be grouped with more than just one topic. Tags can also be nested (ie. have subtags) in Obsidian.
Also, you can link two notes together with links. Obsidian and some other note-taking apps let you connect one note to another so that you can then jump to that note and build your “Knowledge Graph” as shown below:
### When to use Folders
Folders are however useful to organize your vault, especially as it grows. The main advice here is to have very few folders, as they should “weakly” collect groups of notes or better collect different types or sources of notes.
They generally collect different sources of information. For example, these are the folders I use in my Zettelkasten:
MOC: Contains all the Maps of Contents to navigate the Zettelkasten.
Projects: Contains one note for each side-project of my PhD where I log my progress and ideas. These are also linked to notes.
Bio and ML: These two are essentially the main content of my Zettelkasten and they could in theory be fused into one folder.
Papers: Here I place all the notes I take from scientific papers. The notes are synced using a bibliography .bib file from Zotero.
Books: I write a note for each book I read and generally split them into multiple notes after I go through them.
Having a separate folder for images can also be a good idea, to avoid cluttering your main folders with image files.
I will discuss these more in detail in the Workflow Section.
My general suggestion for folders is to minimize them as much as possible and to use tags and links instead.
Maps of Content (MOC)
As you start growing your Zettelkasten, you might find it hard to find notes, especially when taking notes of different topics. A good solution to this is to create notes called Maps of Contents (MOCs).
These are notes that “signposts” your Zettelkasten library, directing you to the right type of notes. Inside of it you can link to other notes based on tags of a common topic. Usually this is done with a title, followed by your notes that relate to that title. This is an example:
As shown above, my Machine Learning MOC starts with the basics, all in one section. It then moves to Variational Auto-Encoders and Transformers. This allows you to group and quickly find all notes related to a tag without having to scroll through the tag search section.
This is why I keep MOCs at the top of my library, as I can quickly find the information I need and get a quick look at my library. These MOCs are automatically generated using an Obsidian Plugin called Dataview https://github.com/blacksmithgu/obsidian-dataview which works much like SQL queries.
Ideally, MOCs can be expanded and should have a bit more explanations about the notes, their status, and what you still need to do. In the absence of this, Dataview does a fantastic job at creating a good structure for your notes.
EDIT: This is the template I use for the screenshot above:
Dataview query for MOC (code)
### Basics
```dataview
table tags as "Tags"
from "2. Notes"
WHERE contains(tags, "optimisation")
SORT file.name ASC
```
### VAE
```dataview
table tags as "Tags"
from "2. Notes"
WHERE contains(tags, "vae")
SORT file.name ASC
```
### Transformers
```dataview
table tags as "Tags"
from "2. Notes"
WHERE contains(tags, "attention")
SORT file.name ASC
```
Alternatively, this is what a book tracker looks like:
Dataview query for books in folder “4. Books”
# Books MOC
```dataview
table author as Author, date as "Date Finished", tags as "Tags", grade as "Grade"
from "4. Books"
SORT grade DESCENDING
```
Where each book note looks like this:
Book note with fields.
### [Books MOC](../0.%20MOC/Books%20MOC.md)
# Social Engineering : The Art of Human Hacking
**Author**:: Chris Hadnagy
**Date**:: 2022-01-01
**Tags**:: #psychology/socialengineering #psychology
**Grade**:: 9/10
**Links**::
## Gathering Information
- **Example**: "Can you tell me one person who you think could benefit from this product as much as you will?"
- As a salesperson you can now call people use that information to be like "Your friend bought XYZ premium / upfront"
2. Tools: Getting to know Obsidian
Obsidian is my tool of choice as it is free, all the notes are stored in Markdown format, it can be customized/themed, and each panel can be moved around in drag and drop fashion. You can download it here: https://obsidian.md/.
Interface
As I mentioned, Obsidian is very customizable, so I found this to be my optimal interface:
My interface in Obsidian. The theme is customized from https://github.com/colineckert/obsidian-things
If you want something simpler, each panel can be collapsed, moved, or removed in whatever way you wish. If you need to find a panel later on, you can click on the vertical “…” (bottom left of the note panel), and open the relevant panel.
Generally my interface is organized as such:
How you can organize your Obsidian Interface.
Folders / Search: Here I have all the relevant folders. I usually use the MOC note to get to wherever I want, otherwise, I use the search button to look for a note.
Tags: I use nested tags and usually look into each of them if I am looking for specific notes to link.
cMenu: Nice plugin to place useful functionality in a handy menu (https://github.com/chetachiezikeuzor/cMenu-Plugin)
Global Graph: The graph shows all your notes (linked and unlinked). Linked notes will appear closer together. You can zoom in to read the title of each note. This can be a bit overwhelming at first, however, as your library grows, you get used to the positions and start thinking of possible connections between notes that you may not have thought about.
Local Graph: This will show your current note, in relation to other linked notes in your library. It is useful to quickly jump to another link when you need to, and go back to the current note.
Links: Finally, here I keep all the linked mentions of the notes, as well as an outline panel and the plugin Power Search (https://github.com/aviral-batra/obsidian-power-search), which allows me to search my vault by highlighting some text.
Plugins
Another major advantage of using Obsidian is the vast choice of plugins. I use many but here are a few of the ones I use the most (Calendar, Citations, Dataview, Templater, Admonition):
Calendar: https://github.com/liamcain/obsidian-calendar-plugin Gives you a calendar to organize your notes. This is optimal for taking notes from meetings or keeping a journal.
Citations: https://github.com/hans/obsidian-citation-plugin Allows you to cite papers from a .bib file to include in your notes. You can also customize how your notes will be produced (eg. Title, Authors, Abstract, etc..)
Dataview: https://github.com/blacksmithgu/obsidian-dataview Probably among the most powerful plugins as it allows you to query your library as a database and automatically generate content. You can see an example in the MOC section.
Templater: https://github.com/SilentVoid13/Templater Allows you to create notes with specific templates like dates, tags, and headings.
Admonition: https://github.com/valentine195/obsidian-admonition Allows you to structure your notes with blocks.
Theme (new addition)
Many have asked about my theme settings and CSS.
My CSS:
- Adds white background to all the images (which allows me to add transparent images and see them properly in dark mode)
- Leave a 40px of space between the title bar and the content
- Increase the font for LaTeX formulae
.markdown-source-view.mod-cm6 .cm-scroller, .markdown-source-view, .cm-s-obsidian, .cm-s-obsidian span.cm-formatting-task{
margin-top: 40px !important;
}
.workspace-leaf.mod-active .view-header {
background: linear-gradient(
120deg
, var(--color-view-header-gradient-2) 0.5%, var(--color-view-header-gradient-2) 0.5%);
}
img{ background: white;}
mjx-math {
font-size: 150% !important;
}
view raw
My settings for the Things theme add additional colors to the headings:
{
"blue-topaz-theme@@color-scheme-options": "color-scheme-options-default",
"blue-topaz-theme@@layout-style-options": "layout-style-options-default",
"blue-topaz-theme@@font-size-folder-and-file": "0.90em",
"blue-topaz-theme@@h1-color@@dark": "#C86E78",
"blue-topaz-theme@@h2-color@@dark": "#C88974",
"blue-topaz-theme@@font-family-vault": "monaco",
"blue-topaz-theme@@translucent-setting-panel": false,
"blue-topaz-theme@@blur-depth": 26,
"blue-topaz-theme@@background-settings-workplace-background-image": false,
"blue-topaz-theme@@clutter-free-headings": true,
"blue-topaz-theme@@background-image-settings-switch": true,
"blue-topaz-theme@@bt-status-off": false,
"blue-topaz-theme@@non-border-bottom-header": false,
"blue-topaz-theme@@circular-checkbox": false,
"blue-topaz-theme@@muted-activeline-bg": false,
"blue-topaz-theme@@rainbow-lines": false,
"blue-topaz-theme@@light-background-color-files": false,
"blue-topaz-theme@@folder-style-change-options-colorful": false,
"blue-topaz-theme@@folder-style-change-options-colorful-subfolder": "folder-colorful-one",
"blue-topaz-theme@@font-family-change-to-default": true,
"things-style@@minimal-icons-off": true,
"things-style@@full-file-names": false,
"things-style@@font-small": 15,
"things-style@@cursor": "default",
"things-style@@macOS-translucent": false,
"things-style@@h3-color": "#B87CDF",
"things-style@@h2-color": "#4B9DC5",
"things-style@@em-color": "#E5B567",
"things-style@@h1": "1.6em"
}
To import my theme settings you will need the plugin Style Settings: https://github.com/mgmeyers/obsidian-style-settings
3. Workflows: Doing cool things
Here I outline a few of my workflows on how I use obsidian to take notes for scientific research. Several of these are very specific to my use-cases but I believe they could be useful. I will first outline and describe each of them briefly to allow you to skim through them quickly.
3.1 Structuring Notes Effectively with Templates
3.2 Syncing Your Notes for Free (Laptop, Phone, Tablet)
3.3 Zotero/Mendeley/JabRef -> Obsidian — Taking Notes and Managing Reading Lists of Scientific Papers
3.4 Managing Projects and Lab Books
3.5 Encrypted and Private Diary
3.1 Structuring Notes Effectively with Templates
Plugins Used: Templater (optional) and Dataview (optional).
To take notes effectively, you must first make the process of adding new notes as simple as possible. Templates can save you a significant amount of time while also giving you a consistent structure to your notes. Below is an example:
An example of a note made with a consistent template.
### [[YOUR MOC]]
# The Title of Your Note
**Tags**::
**Links**::
The topmost line is a link to your Map of Content (MOC), your signpost to explore your knowledge base (see previous sections). After the title, I add tags, that relate the note to topics (and also add a link between the note and the tag) and links to other related notes.
Occasionally, a note might still require work to do, so I add a tag “#todo”, to quickly identify all the notes that need to be expanded. In the “TODO:” section I add the work I need to do within the note.
The rest is followed by notes on the actual topic.
Templater can help you build these templates more easily. For example, I have the following template for new books:
### [[Books MOC]]
# Title
**Author**::
**Date**::
**Tags**::
**Links**
Which I can then hook with Dataview with a simple query like such:
```dataview
table author as Author, date as "Date Finished", tags as "Tags", grade as "Grade"
from "4. Books"
SORT grade DESCENDING
```
Using Dataview to query notes with specific templates.
3.2 Syncing Your Notes for Free (Laptop, Phone, Tablet)
Plugins used: None.
One of the things I love the most about Obsidian is that the format of the library is self-contained and portable. Everything (including plugins) is contained in your folder. Your folders and notes are available as ordinary folders and documents. You will also notice a hidden folder called “.obsidian”. This contains all your plugins and settings, so as long as you have this, you will be able to carry your settings to other devices.
You can therefore use any cloud platform you like, like Google Drive, iCloud, or DropBox for free as long as you sync your folder (note: your folder should be in your Cloud Folder).
3.3 Zotero/Mendeley/JabRef -> Obsidian — Taking Notes and Managing Reading Lists of Scientific Papers
Plugins used: Citations (required).
Zotero is my reference manager of choice although this workflow should work for any reference manager that produces a .bib (bibliography) file. I export this file and keep it in my cloud folder so that I can access it from Obsidian on any platform.
I organize my Zotero library with the following tags:
When I need to do readings, I will usually filter for the tags “!!!” and “To-Read” and choose a paper. I will then annotate the paper (either on PDF using GoodNotes or on physical paper).
Then, I create a page for the paper using a template that you can manage in the Citations plugin settings:
Create a new note and then use CMD / CTRL + P to open up the commands list and find the Citations “Insert literature note content in the current pane” and you will be greeted by this beautiful view.
You can then transcribe your notes into digital format. I found that the process of transcribing helped me retain information better, so I would recommend it.
3.4 Managing Projects and Lab Books
PhD students at the thesis writing stage are usually full of advice (read as regret). I made it a habit of asking them things they would have done earlier or differently. One of the responses stuck with me:
Deep stuff Leo. So my big problem is basic organisation, losing track of the tasks I ve got to do and the reasons that motivate those tasks in the first place. sometimes I d just forget about the experiments that motivated a particular experiment so I d end up going other experiments that didn t make complete sense and having to reverse engineer my logic for thesis writing A wise PhD student, now Postdoc
Organization is key to avoid wasting time. Especially during a PhD, organizing several projects and keeping a lab book for each of them is hard. The way I deal with it is:
- One folder for all my projects
- One file for each project
I then create the header of each project with a template.
### [[Projects MOC]]
# <% tp.file.title %>
**Tags**::
**Links**::
**URL**::
**Project Description**::## Notes:
### <% tp.file.last_modified_date("dddd Do MMMM YYYY") %>
#### Done:
#### TODO:
#### Notes
You can insert a template into a new note with CMD + P and looking for the Templater option.
I then keep adding new days with another template:
### <% tp.file.last_modified_date("dddd Do MMMM YYYY") %>
#### Done:
#### TODO:
#### Notes:
This way you can keep adding days to your project and update with reasonings and things you still have to do and have done. An example below:
Example of project note with timestamped notes.
3.5 Encrypted and Private Diary
Perhaps this is one of my favorite applications of Obsidian.
I have been frustrated with Mini Diary and its interface for a while. After the project got archived by the author I decided to find an alternative. I had two requirements:
- It had to be private, and I wanted absolutely nobody to be able to read the content of the entries.
- It had to sync with the cloud so I could edit it in different devices.
I then found out about encrypting the Obsidian folder on disk. You can then decrypt the folder and open it with Obsidian. The folder can be synced as per usual.
To do this I use CryptoMator (https://cryptomator.org/). You can add a your Obsidian vault as a folder to encrypt on Cryptomator, set up a password and it will take care of the rest.
You can watch this video if you would like a step-by-step video guide
Obsidian Tutorial for Academic Writing
Practical writing Tips for Manuscript Writing, Posters, and exporting citations to Word, PDF, and Latex.
Table of Contents
Using Obsidian for Academic Writing
1- Writing Notes from Papers
— A. Connecting Zotero to Obsidian
— B. Literature Notes Templates
— C. Importing Highlights from Zotero
2- Writing a Manuscript
— A. Insert a Citation in Markdown
— B. Copy MLA Citations to Text
— C. LaTeX-like Figures and Section Referencing (NEW: Added Jan/2023)
3- Exporting your Text (with citations)
— A. Converting Links (Obsidian to Markdown notation)
— B. Exporting to PDF, Word, LaTeX
4- Creating Academic Documents (NEW: Added Dec/2022)
— A. Academic PDF (.pdf) / LaTeX (.tex) Export with Plugin (NEW — Added Jun/2023)
— B. PDF (.pdf) Export with CSS
— C. Bibliography (.bib) Export with Pandoc
— D. PDF (.pdf) Export with Custom Pandoc Template (LEGACY)
— E. LaTeX (.tex) Export with Custom Pandoc Template (LEGACY)
Tools:
Zotero
Zotero Plugins:
– Zotfile
– BetterBibtex
– Mdnotes
Obsidian Plugins:
– Citations
– Pandoc Reference List
– Obsidian Enhancing Export
– Obsidian Link Converter
Pandoc
- Pandoc-Crossref (for dynamic figure and section referencing)
Obsidian Shortcuts:
– Preferences: CMD + ,
– Command Palette: CMD + P
1. Writing Notes from Papers
Zotero is a great open-source reference manager commonly used in academia. Only a few people know that it can be used for highlighting papers and annotating ideas on the PDF document itself. With some tweaks, we can get Zotero to sync this information with Obsidian, so as to have a more convenient space to take notes.
1A. Connecting Zotero to Obsidian
To connect Zotero to Obsidian we need to export a .bib file which includes all the information about your papers. It’s essentially a JSON-looking file that looks like this:
@article{castorina2021,
title = {{{PDBench}}: Evaluating Computational Methods for Protein-Sequence Design},
shorttitle = {{{PDBench}}},
author = {Castorina, Leonardo V and Petrenas, Rokas and Subr, Kartic and Wood, Christopher W},
year = {2023},
month = jan,
journal = {Bioinformatics},
volume = {39},
number = {1},
pages = {btad027},
issn = {1367-4811},
doi = {10.1093/bioinformatics/btad027},
url = {https://academic.oup.com/bioinformatics/article/doi/10.1093/bioinformatics/btad027/6986968},
urldate = {2023-01-26},
langid = {english},
}
To do this, install the plugins:
• Zotfile: http://zotfile.com/
• BetterBibtex: https://retorque.re/zotero-better-bibtex/
• Mdnotes: https://github.com/argenos/zotero-mdnotes/releases/tag/0.2.3
Zotero > Tools > Add-ons > Gear Icon > “Install Add-on from file” then Select the .xpi files and they will be installed.
Then, export your library as a .bib file by:
Right Click on the library > Export Library > Select “BetterBibLatex” and Keep Updated (see below)
Choose a path of your choice. It is a good idea to keep it in the cloud if you use multiple machines.
I would recommend you select your Zotero library to export and set it to automatically export “On Change”. This way your library is always updated as soon as new papers are added to your library. I suggest you export it to a folder you sync with a cloud service. In this case, I am using iCloud, but you could use any other cloud service.
Another option I would recommend is “Export Notes”. Essentially all your highlights and additional notes on papers will be converted to a field in the bibliography file which we can then access from Obsidian.
Check that you did everything correct, by going to the Better BibTex Preferences:
Zotero > Preferences (shortcut: CMD + ,) > Better BibTex > Open Better BibTex Preferences > Automatic Export
1B. Literature Notes Templates
Now onto Obsidian, we will need the Citations Plugin. To install simply go to:
Obsidian > Preferences > Community Plugins > Browse Then type “Citation” in the search bar and click on “Enable”.
Once enabled, close the tab and go to the plugin page:
Set “Citation Database” format to “BibLaTeX” and for the “Citation database path” the path to your .bib file.
You can then scroll down to the template settings and customise how your literature notes will be created:

I use the following template:
# {{title}}
#### ({{year}}) - {{authorString}}
**Link**:: {{URL}}
**DOI**:: {{DOI}}
**Links**::
**Tags**:: #paper
**Cite Key**:: [@{{citekey}}]
### Abstract
```
{{abstract}}
```
### Notes
An example of a note generated with this template is shown below:
1C. Importing Highlights from Zotero
What you’ve seen so far is great, however, if you do most of your highlighting on Zotero PDF files, we can also export them as part of the notes section in the template.
This is especially useful if you highlight on Zotero using a tablet and use their sync utility to sync with your laptop. To do this we use the Mdnotes plugin.
Start by opening a PDF file of a paper in Zotero, and highlight and annotate your document.
In Zotero then find the paper you have highlighted, right-click, and then select “Add Note from Annotations”. You will now see the annotations appearing as a note under the citation.
In Obsidian, open the command palette with:
CMD + P > “Citations: Refresh Citation Database”
This allows your new papers and annotations to be re-loaded in Obsidian from the bibliography file.
If you’re having trouble with the annotations appearing empty, I would suggest exporting the bibliography file again from the preferences menu in Zotero and clicking “Export Now”:
2. Writing a Manuscript
Overleaf and Latex are pretty well-established tools for writing papers. Here, I want to make the case for Obsidian for writing papers. For instance, you can convert your documents from markdown (Obsidian document format) to Word, LaTeX, or PDF, with live citations.
I find this especially useful at the early stages of writing when all my literature notes and ideas are in Obsidian, and the shape of the manuscript will change a lot. This is also great if you are making a poster in Inkscape, Sketch, or PowerPoint, as you can export your poster content to a Word document (including the citations).
If you want to proceed you’ll need to install Pandoc. In my experience, installing Pandoc with Brew is much easier if you are on macOS or Linux.
2A. Insert a citation in Markdown
If you have installed the Citations plugin in Obsidian, inserting a citation is as simple as:
CMD + P > Citations: Insert Markdown Citations
You’ll see a menu like the one below:
In this menu you can search through your bibliography file. You can then add citations to a document. You can customise the way they look from the Citations plugin preferences.
2B. Copy MLA citations to text
If you create a literature note with the Citations plugin or you include a markdown citation in a document, you can use the Pandoc Reference List plugin to display active citations for the document:
This can then easily be copied (with formatting) into Word:
Your in-text citations will also be rendered when you hover on them:
You can install the plugin from Obsidian preference pane as explained earlier. I set up the plugin as such:
Make sure the path to the Bibliography file and pandoc are correct. If you are unsure about the pandoc path, open the terminal and type :
>>> which pandoc
/usr/local/bin/pandoc
2c. LaTeX-like Figures and Section Referencing [NEW]
If you have worked with LaTeX before, you will know about how easy it is to reference figure numbers, even if you were to insert new figures down the line. Something similar can be achieved with Markdown and Obsidian using Pandoc-Crossref (https://github.com/lierdakil/pandoc-crossref).
The easiest way is to install using Homebrew on MacOS, (though it can similarly be installed in Linux and Windows):
brew install pandoc-crossref
Keep in mind that this works only if you also installed pandoc with brew.
Now, all you need is to write {#fig:your_fig_name} next to your figures as such:
{#fig:your_fig_name}
And in-text, reference the figure with: @fig:your_fig_name
Same thing can be done with sections:
# Your Section {#sec:your_section}
3. Exporting Your Text
Exporting your notes will require:
1- Pandoc (mentioned in Section 2)
2- Pandoc-Crossref (for dynamic figure/section references)
3- Obsidian Link Converter
4- Obsidian Enhancing Export
As mentioned in the previous section, you can install the Obsidian Plugins from the community plugins under the preference panel.
3A. Converting Links (Obsidian to Markdown notation)
First, we will use the Obsidian Link Converter to convert all links to markdown. This is necessary due to compatibility issues with Pandoc. To do this:
CMD + P > click the option to convert links in your vault to markdown.
This command converts image links from this format:
![Screenshot 2022-07-04 at 13.05.14.png]
to this:

bibliography which is where you specify your bibliography file if you want your citations to be rendered. Example:
--bibliography="export-data.bib"
pdf-engine is the path to pdflatex. To find it, simply type “which pdflatex” in your terminal. Example:
--pdf-engine=/Library/TeX/texbin/pdflatex
filter if you have used latex-like references to images, you will need to add the pandoc-crossref as a filter BEFORE citeproc
--filter pandoc-crossref
citeproc tells pandoc to render the citations. We just add it as a flag like this:
--citeproc
Examples of the full Extra Arguments configs (for PDF, Word and LaTeX):
--resource-path ~/Library/Mobile\ Documents/com~apple~CloudDocs/
--resource-path ~/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/knowledgebase/Images/
--csl https://raw.githubusercontent.com/csthiago/zotero-citation-styles/master/ieee.csl
--bibliography="export-data.bib"
--pdf-engine=/Library/TeX/texbin/pdflatex
--filter pandoc-crossref
--citeproc
Once you are done, you will see that the document will contain all your images and citations. If you exported to latex, all the citations will be rendered from your .bib file.
Note that you can pass a .csl file for citation styles. You can either use a file or a URL as above. You can find other styles in the repository: https://github.com/csthiago/zotero-citation-styles
Once you found the style you are interested in, click on it, then click on “Raw” and copy the URL:
4. Creating Academic Documents [NEW]
Section 3 showed you how you can produce a document. Here we will look into styling these into professionally-looking academic documents. There are two ways to do this:
4A. Academic PDF (.pdf) / LaTeX (.tex) Export with Plugin
The advantage of using this solution over CSS is that figures and references are rendered in full, much like latex. I developed a feature of the Obsidian Enhancing Export plugin which allows the selection of academic templates from a dropdown menu (see .gif).
If you followed the steps in Section 3b, simply run:
CMD + P > "Obsidian Enhancing Export: Export To…" > Set Type as "PDF"
From the dropdown select your template of choice and that should be it. At the time of writing there are two templates available: Dissertation and NeurIPS (academic). Refer to this repository for more information on how to use each one of them: https://github.com/universvm/obsidian-pandoc-templates
4B. PDF (.pdf) Export with CSS
This involves adding a custom .css file to Obsidian. Simply go to this website:
https://raw.githubusercontent.com/NicklasVraa/Obsidian-academic-export/main/academic-pdf-export.css
And save the file.
Now go to Obsidian > Preferences > Appearance > CSS Snippets
Click on the Folder icon and drag your academic-pdf-export.css file to it. Your preferences should now look like this:
Now, open a note and use the command pallette (CMD/CTRL + P) to select "Export to PDF". Your output should now be nicely formatted.
4C. Bibliography (.bib) Export with Pandoc
If using the methods above you may wonder how to export a .bib file containing uniquely the citations used in your document and filter out any entries that are not referenced in the document.
As before we go into the Export Setting preferences. In “Choose Template” select “Extra Arguments”:
For the command, paste the following and adapt as for the previous section:
--to=biblatex
--resource-path ~/Library/Mobile\ Documents/com~apple~CloudDocs/
--bibliography="export-data.bib"
- The
— to=biblatexflag selects the output file extension to “.bib” - You can reuse the same
— resource-pathand— bibliographyas before.
And there you have it! It should now export to a .bib file in your selected output path. As before:
CMD + P > “Obsidian Enhancing Export: Export To…” > Set Type as “Bibliography”
4D. PDF (.pdf) Export with Custom Pandoc Template (LEGACY)
If you followed the guide above and have Pandoc setup, using a custom template is also relatively simple. We essentially just need to add the custom template to Pandoc.
First download the file pandoc template file from here: https://gist.github.com/universvm/5eaa79f8c65a42c5914b449fc4a53069
Then, open a terminal and type:
pandoc --version
You will find your user data directory path. Open that path, and if it does not exist create a folder called “pandoc” in there.
Now, create another folder called “templates” and place the eisvogel.tex file in there. Your folder should look like this:
Back to Obsidian, go to Preferences > Export Settings and under Choose Setting create a new one called “Academic PDF”:
In the extra arguments we want to select the template like this:
--number-sections
--resource-path ~/Library/Mobile\ Documents/com~apple~CloudDocs/
--resource-path ~/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/knowledgebase/Images/
--filter pandoc-crossref
--citeproc
--bibliography="export-data.bib"
--pdf-engine=/Library/TeX/texbin/pdflatex
--template eisvogel.tex
-M reference-section-title=References
--csl https://raw.githubusercontent.com/csthiago/zotero-citation-styles/master/ieee.csl
--metadata link-citations
Now, open a note, open the command palette and click on Obsidian Enhancing Export: Export To…. select Academic PDF and click on Export.
To produce the document in the screenshot I added the following before my note (YAML):
---
title: "Thesis Title"
subtitle: "Another Subtitle"
titlepage: True
toc: true
toc-own-page: True
author: [Example Author]
date: "2022-02-12"
keywords: [Markdown, Example]
titlepage-text-color: "000000"
titlepage-rule-color: "FFFFFF"
titlepage-rule-height: 0
toc-title: Table of Contents
caption-justification: justified
titlepage-logo: /Users/your_name/Documents/logo.pdf
abstract: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eu accumsan nisl. Phasellus suscipit varius arcu nec congue. Ut non pharetra dui. Phasellus gravida lectus eget maximus tincidunt. Nam ut ex vel enim elementum malesuada. Proin sit amet iaculis velit, non feugiat nulla. In facilisis tempor posuere. Nunc id dui eget lacus accumsan finibus. Ut id ex condimentum, egestas leo quis, tincidunt neque. Proin tincidunt, odio a sagittis rutrum, erat mi volutpat lorem, non iaculis odio sem in dui.
acknowledgements: Donec nec sapien porttitor, pharetra odio ac, suscipit nulla. Nulla mattis purus a facilisis vestibulum. Curabitur orci lorem, convallis ut odio quis, bibendum malesuada ligula. Pellentesque ultrices velit et hendrerit vulputate. Duis lobortis quis dui et condimentum. Aenean elementum id ex sit amet placerat. Vivamus a rhoncus dui, id volutpat nibh. Ut suscipit et augue eget imperdiet. Phasellus mattis vitae lectus nec pulvinar. Nulla pulvinar risus finibus tortor aliquam lacinia. Curabitur sagittis id turpis non varius.
text1: Doctor of Philosophy
text2: School of Informatics
text3: University of Edinburgh
text4: 2022
---
There are a lot more configs you can use. The full list is available here: https://github.com/Wandmalfarbe/pandoc-latex-template
The version you installed is a slightly modified version of the above to allow for an Abstract, Acknowledgement and general styling.
4E. LaTeX (.tex) Export with Custom Pandoc Template [LEGACY]
Conclusion
In this article, I showed my entire workflow for writing academically using Obsidian while syncing everything with iCloud.
The workflow is meant to help you deal with installing and setting up plugins and is the result of hours of work and research through forum posts.
First, we saw how to connect Zotero, a popular reference manager, to Obsidian and sync literature notes and highlights into notes files.
Then, I explained how I use markdown citations to help me build a draft for a manuscript. The citations can then be rendered using pandoc and exported to text, which is helpful if you’re creating a poster with InkScape or PowerPoint.
Finally, we set up the Obsidian Enhancing Export plugin with Pandoc to generate Latex, Word, and PDF documents to then import to Overleaf or send to other authors as a draft.
Cherry on top is a short tutorial on how to create academically-looking (and visually pleasing) documents with CSS and pandoc templates.